import axios from "axios";
import {
    Host_Ip
  } from "../config.js"

export function GetBuilding () {
  return axios({
    url: Host_Ip + '/admin/building/allList',
    method: 'get'
  })
}
export function GetBuildingDetail (params) {
  return axios({
    url: Host_Ip + '/admin/buildingDetail/allList?buildingId=' + params,
    method: 'get'
  })
}
export function GetRoom (params) {
  return axios({
    url: Host_Ip + '/admin/room/allList?buildingId=' + params.buildingId + '&buildingDetailId=' + params.buildingDetailId,
    method: 'get'
  })
}

export function getList (parameter) {
  return axios({
    url: Host_Ip + '/admin/room/inspect/list',
    method: 'get',
    params: parameter
  })
}

export function getPlanList (parameter) {
  return axios({
    url: Host_Ip + '/admin/room/inspect/plan/list',
    method: 'get',
    params: parameter
  })
}

export function planList (params) {
  return axios({
    url: Host_Ip + '/admin/room/inspect/plan/listAll',
    method: 'get',
    params: params,
  })
}

export function saveItem (parameter) {
  return axios({
    url: Host_Ip + '/admin/room/inspect/save',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delItem (parameter) {
  return axios({
    url: Host_Ip + '/admin/room/inspect/remove',
    method: 'post',
    params: parameter
  })
}
export function getItemById (id) {
  return axios({
    url: Host_Ip + '/admin/room/inspect/get/' + id,
    method: 'get'
  })
}